//
//  ProtocolBase.h
//  Protocol
//
//  Created by  user on 11-1-10.
//  Copyright 2011 GuangZhouXuanWu. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "ProtocolTransformType.h"

@class CProtocolStream;

@class CProtocolHTTPSREST;

@interface CProtocolBase : NSObject 
{
	short _nStrencoding;
	Byte _btVersion;
	short _nCommandID;
	NSInteger _nErrorcode;
	NSString* _szErrormsg;
	
//	int m_nEnc;
    
    EProtocolTransformType _transformType;
}

//@property(nonatomic,assign) int m_nEnc;
@property(nonatomic,readonly) short commandID;
@property(nonatomic,readonly) NSInteger nErrorcode;
@property(nonatomic,readonly) NSString* szErrormsg;
@property(nonatomic,readonly) EProtocolTransformType transformType;

-(id)initWithCommandid:(short)nCommandid;



-(void)write:(CProtocolStream *)ps;

-(BOOL)read:(CProtocolStream *)ps;

-(void)read:(CProtocolStream *)ps output:(NSObject**)obj;



-(void)writeHTTPSREEST:(CProtocolHTTPSREST*)phr;

-(NSDictionary*)readHTTPSREEST:(CProtocolHTTPSREST*)phr;

-(void)readHTTPSREEST:(CProtocolHTTPSREST*)phr output:(NSObject**)obj;



+(void)setProtocolSessionID:(NSString*)guid;

+(NSString*)protocolSessionID;

@end
